//
//  XTXSexButton.m
//  xiaotianxin
//
//  Created by apple on 2019/12/18.
//  Copyright © 2019 apple. All rights reserved.
//

#import "XTXSexButton.h"

@implementation XTXSexButton

-(void)setSelected:(BOOL)selected{
    [super setSelected:selected];
    if (selected) {
        self.layer.cornerRadius=30;
        self.layer.masksToBounds=YES;
        [self.layer setBorderWidth:2];//设置边界的宽度
        self.layer.masksToBounds=YES;
        //设置按钮的边界颜色
        CGColorSpaceRef spaceRef = CGColorSpaceCreateDeviceRGB();
        CGColorRef colorRef = CGColorCreate(spaceRef, (CGFloat[]){255/255.0, 0/255.0, 0/255.0, 1});
        [self.layer setBorderColor:colorRef];
    }else{
        CGColorSpaceRef spaceRef = CGColorSpaceCreateDeviceRGB();
        CGColorRef colorRef = CGColorCreate(spaceRef, (CGFloat[]){255/255.0, 255/255.0, 255/255.0, 1});
        [self.layer setBorderColor:colorRef];
    }
}
-(void)setHighlighted:(BOOL)highlighted{
}
@end
